<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>

<script language="JavaScript"> 
	document.getElementById('finder').style.display = 'block';
</script>

<%@ include file="/WEB-INF/jsp/partnerTools.jsp" %>

<h2> Job offers </h2>


<h3> Last update: <c:out value="${updateTime}"/> ago </h3>


<table class="searchTable">
	<form:form method="POST" commandName="jobSearchCriteria">
	<tr>
		<td>
			Select country:
		</td>
		<td>
			<form:select path="country">
				<form:option value="">All countries</form:option>
				<form:options itemLabel="name" />
			</form:select>
		</td>

	</tr>
	
	
	<tr>
		<td>
			Select alliance:
		</td>
		<td>
			<form:select path="alliance">
				<form:options itemLabel="name" />
			</form:select>
		</td>

	</tr>

	
	<tr>
		<td>
			Required skill:
		</td>
		<td>
			<form:select path="minimalSkill">
				<form:options itemLabel="value" />
			</form:select>
		</td>
	</tr>



	
	<tr>
		<td colspan="2">
			<center><input type="submit" value="Show"></center>
		</td>
	</tr>
	</form:form>
</table>
<br/>


<%@ include file="/WEB-INF/jsp/commercials.jsp" %>




<table width="800" border="2" cellpadding="2" cellspacing="0" bordercolor="777777" width="800" style="text-align: center; font-size: 11px">
	
		<tr style="background: #c0c0c0"> 
			<td>Country</td> 
			<td>Skill level</td>
			<td>Salary <u>before</u> taxes</td>
			<td>Taxes</td> 
			<td><b>Salary <u>after</u> taxes</b></td> 
			<td>Number of offers</td>
			<td>Company</td> 
		</tr>
	
		<c:forEach var="job" items="${jobs}" >
		
		
			<tr style="background: none repeat scroll 0% 0% <c:out value="${job.country.alliance.color}"/>;">
			<td> 
				<img src="http://www.erepublik.com/images/flags/M/<c:out value="${job.country.urlName}"/>.gif"/><br/>
				<c:out value="${job.country.name}"/> (<c:out value="${job.country.alliance.name}"/>)
			</td>
		

				<td>
					<c:out value="${job.minimalSkill}"/>
				</td>
	
				<td>
					<c:set var="salariInLocalBeforeTax"><fmt:formatNumber value="${job.salaryInLocalBeforeTax}" maxFractionDigits="2"/></c:set>
					<c:set var="salariInGoldBeforeTax"><fmt:formatNumber value="${job.salaryInGoldBefore}" maxFractionDigits="4"/></c:set>
					
					<c:out value="${salariInLocalBeforeTax}"/>
					<c:out value="${job.country.currencyName}"/><br/>
					<c:out value="${salariInGoldBeforeTax}"/>
				
					<img src="http://34all.org/erep/gold.gif"/>
				</td>
				<td>
					<c:out value="${job.incomeTax}"/>%
				</td>
				<td><b>
					<c:set var="salariInGoldAfter"><fmt:formatNumber value="${job.salaryInGoldAfterTax}" maxFractionDigits="4"/></c:set>
						<c:out value="${salariInGoldAfter}"/>
					
					<img src="http://34all.org/erep/gold.gif"/>
					</b>
				</td>
				
				<td>
					<c:out value="${job.offerNumbers}"/>
				</td>
				
				<td>
					<img width="35" src="<c:out value="${job.img}"/>"/><br/>
					<a href="http://economy.erepublik.com/en/company/dupaDupuDUPA/<c:out value="${job.companyId}"/>" target="_blank"> <c:out value="${job.companyName}"/> </a>
				</td>
				
		
			</tr>
		</c:forEach>
</table>


<%@ include file="/WEB-INF/jsp/bottom.jsp" %>

